﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using System.Data.SqlClient;

namespace BLL
{
    /// <summary>
    /// 角色表
    /// </summary>
    public class RolesBll
    {
        RolesDal dal = new RolesDal();

        /// <summary>
        /// 显示
        /// </summary>
        /// <returns>List集合</returns>
        public List<Model.SysRoles> Show(params SqlParameter[] paramters)
        {
            return dal.Show(paramters);
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="t">实体对象</param>
        /// <returns>bool类型 true为添加成功，false为添加失败</returns>
        public bool Add(Model.SysRoles r)
        {
            return dal.Add(r);
        }

        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="r"></param>
        /// <returns></returns>
        public bool DelRole(Model.SysRoles r)
        {
            return dal.Del(r);
        }

        /// <summary>
        /// 反填角色信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<Model.SysRoles> BackRoles(int id)
        {
            return dal.BackRoles(id);
        }

        /// <summary>
        /// 修改角色信息
        /// </summary>
        /// <param name="r"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool UpdateRole(Model.SysRoles r, int id)
        {
            return dal.Update(r, id);
        }

        /// <summary>
        /// 停用角色
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool StopRole(int id)
        {
            return dal.StopRole(id);
        }

        /// <summary>
        /// 启用角色
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool StartRole(int id)
        {
            return dal.StartRole(id);
        }
    }
}
